#ifndef DRAWER_H
#define DRAWER_H

#include <QMainWindow>
#include <QPainter>
#include <QMouseEvent>

namespace Ui {
class drawer;
}

class drawer : public QMainWindow
{
    Q_OBJECT

public:
    explicit drawer(QWidget *parent = 0);
    ~drawer();

    void paintEvent(QPaintEvent*);
    void mouseMoveEvent(QMouseEvent*);
    void mousePressEvent(QMouseEvent*);
    void mouseReleaseEvent(QMouseEvent*);

    //公共变量


private:
    QVector<QVector<QPoint> > _lines;
//    QVector<QColor> colors;
    Ui::drawer *ui;
//    QColor lastcolor = Qt::black;
    QVector<QPen> pens;
    QPen lastpen;
};

#endif // DRAWER_H
